package vip.aning.gitsync.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DatetimeUtil {

    // 定义格式化器
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    public static String getCurrentDateTime() {
        // 获取当前时间
        LocalDateTime now = LocalDateTime.now();
        // 格式化时间为字符串
        return now.format(FORMATTER);
    }
}
